<?php
defined('BASEPATH') OR exit('No direct script access allowed');

/**
 * 公共接口
 * @author www.dingwei.cn
 */
class Common extends MY_Controller {
	
	/**
	 * 设置模块
	 * @var AdmSettingModel
	 */
	public $mSetting;
	public function __construct(){
		parent::__construct();
		$this->loadModel('AdmSettingModel', 'mSetting', 'admin');
	}
	
	/**
	 * 获取地址
	 */
	public function getLocation(){
		//表单验证
		$vConf = array(
				array('parent_id', '上级id', 'required|is_natural_no_zero'),
				
		);
		$this->formDataValidation($vConf);
		
		$parentId = trim(post('parent_id'));
		
		$tA = $this->mSetting->getLocationByPid($parentId);
		
		$this->appReturn(1,'',$tA);
	}

    /**
     * 关于我们
     */
    public function aboutUs(){
        $tA = $this->mSetting->getExplain('about_us');
        $tA = str_replace('{base_url}', base_url(), $tA);

        $this->appReturn(1,'',$tA);
    }

    /**
     * 注册协议
     */
    public function agreement(){
        $tA = $this->mSetting->getExplain('merchant_agreement');
        $tA = str_replace('{base_url}', base_url(), $tA);

        $this->appReturn(1,'',$tA);
    }



    /**
     * 提现说明
     */
    public function withdraw(){
        $tA = $this->mSetting->getExplain('merchant_withdraw_desc');
        $tA = str_replace('{base_url}', base_url(), $tA);

        $this->appReturn(1,'',$tA);
    }

}